Carbon


DisableMenuItem

Header: Menus.h Carbon status: Supported

Disables a menu item or a menu.

void DisableMenuItem (
    MenuHandle theMenu, 
    UInt16 item
);
theMenu

A handle to the menu containing the item to be disabled.

item

A value specifying the item number of the menu item that you wish to disable. Pass 0 to specify the menu title (disabling the entire menu).

DISCUSSION

The DisableMenuItem function disables a menu item (and any associated icon) so that the user cannot choose the item from the menu. Unlike the pre–Mac OS 8.5 Menu Manager function DisableItem, the DisableMenuItem function can disable individual menu items with item numbers greater than 31.

If your application disables a menu title using DisableMenuItem, it should then call either the DrawMenuBar function or the InvalMenuBar function to update the menu bar’s appearance.

See also the EnableMenuItem and IsMenuItemEnabled functions.

VERSION NOTES

This function is available with Mac OS 8.5 and later.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when MenusLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by MenusLib 8.5 and later.

CARBON NOTES

Note that the implementation of Carbon on Mac OS 8.1 only supports disabling menu items less than or equal to 31.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)